/**
 * Header de Piece.cxx
 *
 * @file Piece.h
 */

#if !defined Piece_h
#define Piece_h

#include <tr1/memory>

class Echiquier;

/**
 * Declaration d'une classe modélisant une piece de jeu d'echec.
 */
class Piece
{
	public:
		Piece();
		Piece(int x, int y, bool color);
		Piece(const Piece &p);
		virtual ~Piece();

		void init(int x, int y, bool white);
		void move(int x, int y);
		int x() const;
		int y() const;
		bool isWhite() const;
		bool isBlack() const;
		void affiche() const;

		virtual bool mouvementValide(Echiquier *e, int x, int y) = 0;
		bool mouvementAutorise(Echiquier *e, int x, int y);

	protected:
		int m_x;
		int m_y;
		bool m_white;
};

typedef std::tr1::shared_ptr<Piece> PiecePtr;

#endif // !defined Piece_h
